package com.atm.simulation.bankSim;

import java.util.HashMap;
import java.util.Map;

//远程账户信息（静态模拟）
public class AccountList {

private Map<String, Account> accountList = new HashMap<String, Account>();
	
	public AccountList(){
		Customer customer1 = new Customer("唐僧","0001","123456");
		Customer customer2 = new Customer("八戒","0002","123457");
		Customer customer3 = new Customer("悟空","0003","123458");
		Account account1 = new Account("0001",2000,customer1,"1234");
		Account account2 = new Account("0002",5000,customer2,"1234");
		Account account3 = new Account("0003",4500,customer3,"1234");
		accountList.put("0001", account1);
		accountList.put("0002", account2);
		accountList.put("0003", account3);
	}
	
	// 根据卡号查找一个账户
	public Account getAccountByCardNo(String cardNo){
		return accountList.get(cardNo);
	}
}
